{% extends 'basic_app/master.html' %}
{% block tag_left %}
    {% include 'oratk_app/tag_left_user.html' %}
{% endblock %}
{% block title %}
    <title>ORATK</title>
{% endblock %}
{% block userinfo %}
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        <h2 class="page-header">编辑监控项</h2>
        <form class="form-horizontal" action="{{ request.path }}"   method="post">
            <div class="form-group" style="display:none" >
                <label  class="col-sm-2 control-label">id：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control"  placeholder="id" name="v_id" value={{ cron_point_info_result.id }} >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">name：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control"  placeholder="名称" readonly="readonly" name="add_name" value="{{ cron_point_info_result.name }}" >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">desc：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control"  placeholder="描述" name="add_desc" value="{{ cron_point_info_result.desc }}" >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">sqltext：</label>
                <div class="col-sm-10"  >
                    <textarea type="text"  style="height: 110px;" class="form-control" placeholder="sqltext" id="sqltext" name="add_sqltext">{{ cron_point_info_result.sqltext }}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">point_type：</label>
                <div class="col-sm-10">
                    <input type="text" style="width:300px;" class="form-control" name="add_point_type" id="point_type" placeholder="类别" value={{ cron_point_info_result.point_type }} >
                </div>
            </div>
            <div class="form-group" id="mail_status_div">
                <label class="col-sm-2 control-label" >limit_status：</label>
                <div class="col-sm-3">
                    <select  class="form-control" id="add_limit"  name="add_limit">
                        <option>{{ cron_point_info_result.limit }}</option>
                        <option>否</option>
                        <option>是</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">status：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="状态" name="add_status" value={{ cron_point_info_result.status }} >
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-2 control-label">remake：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="备注"  name="add_remake" value={{ cron_point_info_result.remake }} >
                </div>
            </div>
            <div class="col-sm-10">
                <div style="text-align:center;vertical-align:middle;"><button type="submit" class="btn ">提交</button></div>
            </div>
        </form>
    </div>
{% endblock  %}

{% block script %}
<script>
 $(document).ready(function() {
     var point_type = $('#point_type').val()
     if (point_type == 'host类'){
         $('#sqltext').attr("readonly","readonly")
     }
 })
</script>
{% endblock %}